const Attribute = Java.loadClass("net.minecraft.world.entity.ai.attributes.RangedAttribute")

StartupEvents.registry("attribute", event => {
    event.createCustom("eou:generic.max_mana", () => {//最大魔力值
        return new Attribute("attribute.eou.name.generic.max_mana", 100, 0, 40960).setSyncable(true)
    })
    event.createCustom("eou:generic.mana_regain_speed", () => {//魔力恢复速度
        return new Attribute("attribute.eou.name.generic.mana_regain_speed", 1, 0, 40960).setSyncable(true)
    })
    event.createCustom("eou:generic.mana_cost_redce", () => {//魔力减免
        return new Attribute("attribute.eou.name.generic.mana_cost_redce", 1, 0, 2).setSyncable(true)
    })
    event.createCustom("eou:generic.cooldown_time_reduce", () => {//冷却缩短
        return new Attribute("attribute.eou.name.generic.cooldown_time_reduce", 1, 0, 2).setSyncable(true)
    })
    event.createCustom("eou:generic.item_skill_damage", () => {//技能伤害
        return new Attribute("attribute.eou.name.generic.item_skill_damage", 1, 0, 40960).setSyncable(true)
    })
    event.createCustom("eou:generic.bow_damage_increase", () => {//远程伤害
        return new Attribute("attribute.eou.name.generic.bow_damage_increase", 1, 0, 40960).setSyncable(true)
    })
    event.createCustom("eou:generic.luck", () => {//幸运
        return new Attribute("attribute.eou.name.generic.luck", 0, 0, 40960).setSyncable(true)
    })
    event.createCustom("eou:generic.attack_damage", () => {//近战伤害
        return new Attribute("attribute.eou.name.generic.attack_damage", 1, 0, 40960).setSyncable(true)
    })
    event.createCustom("eou:generic.bow_pulling_speed", () => {//拉弓速度
        return new Attribute("attribute.eou.name.generic.bow_pulling_speed", 1, 0, 40960).setSyncable(true)
    })
    event.createCustom("eou:generic.dig_speed", () => {//挖掘速度
        return new Attribute("attribute.eou.name.generic.dig_speed", 1, 0, 40960).setSyncable(true)
    })
})

ForgeModEvents.onEvent("net.minecraftforge.event.entity.EntityAttributeModificationEvent", event => {
    console.log("属性添加");
    event.add("player", "eou:generic.max_mana")
    event.add("player", "eou:generic.mana_regain_speed")
    event.add("player", "eou:generic.mana_cost_redce")
    event.add("player", "eou:generic.cooldown_time_reduce")
    event.add("player", "eou:generic.item_skill_damage")
    event.add("player", "eou:generic.bow_damage_increase")
    event.add("player", "eou:generic.luck")
    event.add("player", "eou:generic.attack_damage")
    event.add("player", "eou:generic.bow_pulling_speed")
    event.add("player", "eou:generic.dig_speed")
    console.log("属性添加666");

})

